package com.kugou.miniapp.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

public class Mail {
    private int id;
    private String theme;
    private String from_user_id;
    private String to_user_id;
    private String msg;
    private Users from_user;
    private Users to_user;
    @JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
    private Date time;

    @Override
    public String toString() {
        return "Mail{" +
                "id=" + id +
                ", theme='" + theme + '\'' +
                ", from_user_id='" + from_user_id + '\'' +
                ", to_user_id='" + to_user_id + '\'' +
                ", msg='" + msg + '\'' +
                ", from_user=" + from_user +
                ", to_user=" + to_user +
                ", time=" + time +
                '}';
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTheme() {
        return theme;
    }

    public void setTheme(String theme) {
        this.theme = theme;
    }

    public String getFrom_user_id() {
        return from_user_id;
    }

    public void setFrom_user_id(String from_user_id) {
        this.from_user_id = from_user_id.substring(0, 20);
    }

    public String getTo_user_id() {
        return to_user_id;
    }

    public void setTo_user_id(String to_user_id) {
        this.to_user_id = to_user_id.substring(0, 20);
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Users getFrom_user() {
        return from_user;
    }

    public void setFrom_user(Users from_user) {
        this.from_user = from_user;
    }

    public Users getTo_user() {
        return to_user;
    }

    public void setTo_user(Users to_user) {
        this.to_user = to_user;
    }



}
